<template>
	<div>
		<van-field 
			v-model="value" 
			:label="label"
			:type="type"
			:placeholder="placeholder"
			:rules="rules"
			@input="input"
		/>
	</div>
</template>

<script>
/* 
	@label
	@type
	@placeholder
	@rule
	@input
*/
	export default {
		props: {
			label: {
				type: String,
				default: '文本'
			},
			type: {
				type: String,
				default: 'text'
			},
			placeholder: {
				type: String,
				default: '请输入'
			},
			rules: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				value: ''
			}
		},
		methods: {
			input() {
				this.$emit('input',this.value)
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>